package com.brianxia.onlineproblemsolution.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Optional;

/**
 * @author brianxia
 * @version 1.0
 * @date 2021/10/8 15:57
 */
@RestController
@RequestMapping("/cpu")
public class CPUController {

    @GetMapping("/high")
    public void cpuHigh(){
        int num = 12;
        Thread[] threads = new Thread[num];
        for (int i = 0; i < num; i++) {
            threads[i] = new Thread(() -> {
                while (true) {

                }
            });
            threads[i].start();
        }
    }
}
